using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using RC.ControlAcceso.Reportes;
using RC.ControlAcceso.ObjetosNegocio;
using System.Collections.Generic;
using System.IO;
using DevExpress.Data;
using DevExpress.Web.ASPxGridView;

public partial class CAReporteHorasExtras : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {        
        if (!IsPostBack)
        {
            txtFechaDesde.Text = DateTime.Now.ToString("dd/MM/yyyy");
            txtFechaHasta.Text = DateTime.Now.ToString("dd/MM/yyyy");
        }

        try
        {
           
        }
        catch 
        {
            
        }
        CAConfiguracionRegionalON.AplicarConfiguracion();
        MenuSuperior1.Encabezado("Reporte de horas Extras Realizadas");
        MenuSuperior1.MenuGrande(true);
    }
    private void abreVentana(string ventana)
    {
        //string Clientscript = "<script>window.open('" +
        //                      ventana +
        //                      "')</script>";

        //if (!this.IsStartupScriptRegistered("WOpen"))
        //{
        //    this.RegisterStartupScript("WOpen", Clientscript);
        //}
    }
    
    protected void btnExprotarPDF_Click(object sender, EventArgs e)
    {
        gvExport.ReportHeader = "Horas Extra desde " + txtFechaDesde.Text + " hasta " + txtFechaHasta.Text;
        gvExport.FileName = ("Horas Extra" + txtFechaDesde.Text + " a " + txtFechaHasta.Text).Replace("/", "-");
        gvExport.WritePdfToResponse();
    }
    protected void btnExportarExcel_Click(object sender, EventArgs e)
    {
        gvExport.ReportHeader = "Horas Extra desde " + txtFechaDesde.Text + " hasta " + txtFechaHasta.Text;
        gvExport.FileName = ("Horas Extra" + txtFechaDesde.Text + " a " + txtFechaHasta.Text).Replace("/", "-");
        gvExport.WriteXlsToResponse();
    }
    protected void dsReportes_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        if (!IsPostBack)
            e.Cancel = true;
    }
    protected void btnBuscar_Click1(object sender, EventArgs e)
    {
        ASPxGridView1.DataBind();
    }
}
